package com.example.demo.util;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 *
 */
@Data
@Builder
@NoArgsConstructor
@ApiModel(value = "返回信息")
public class R<T> implements Serializable {

    private static final long serialVersionUID = - 1509361309137840458L;

    @ApiModelProperty(value = "返回码")
    private Integer code;
    @ApiModelProperty(value = "提示信息")
    private String msg;
    @ApiModelProperty(value = "错误码")
    private Long errorCode;
    @ApiModelProperty(value = "返回数据")
    private T data;

    public R(Integer code, String msg, Long errorCode, T data) {
        this.code = code;
        this.msg = msg;
        this.errorCode = errorCode;
        this.data = data;
    }
}